package com.qfedu.openplateform.manager.service.impl;

import com.qfedu.openplateform.manager.dao.ApiMappingMapper;
import com.qfedu.openplateform.manager.entity.ApiMapping;
import com.qfedu.openplateform.manager.service.ApiMappingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author: 叶上秋
 * @date: 2021/10/27 16:48
 * @version: 1.0
 * @description: 路由管理表
 */

@Service
@Transactional
public class ApiMappingServiceImpl implements ApiMappingService {

    @Autowired
    private ApiMappingMapper apiMappingMapper;
    @Override
    public List<ApiMapping> findAllApiMapping() {
        return apiMappingMapper.findAllApiMapping();
    }

    @Override
    public void addApiMapping(ApiMapping apiMapping) {
        apiMappingMapper.addApiMapping(apiMapping);
    }

    @Override
    public void deleteApiMapping(Integer[] ids) {
        for (Integer id : ids) {
            apiMappingMapper.deleteApiMapping(id);
        }

    }

    @Override
    public void updateApiMapping(ApiMapping apiMapping) {
        apiMappingMapper.updateApiMapping(apiMapping);
    }
}
